<extend name="Layout:base"/>

<block name="title">班级管理</block>
<block name="css">

</block>
<block name="xtyhgl">active</block>
<block name="xsgl">active</block>
<block name="menu">
    <h5 class="breadcrumbs-title">班级管理</h5>
    <ol class="breadcrumbs">
        <li><a href="{:U('Admin/Index/index')}">首页</a>
        </li>
        <li class="active">班级管理
        </li>
    </ol>
</block>

<block name="main">
    <div class="col s12 l12 m12">
        <a class="waves-effect waves-light btn green" href="{:U('Admin/UserMag/addStu')}">添加学生</a>
        <!--<a class="waves-effect waves-light btn orange" href="#">批量导入学生</a>-->
        <a class="modal-trigger waves-effect waves-light orange btn" href="#modal1">批量导入学生</a>
        <a class="waves-effect waves-light blue btn" href="{:U('Admin/UserMag/outputStu')}">导出所有学生</a>
        <div id="modal1" class="modal">
            <form action="{:U('Admin/UserMag/importStu')}" method="post" enctype="multipart/form-data">
                <div class="modal-content">
                    <div class="row">
                        <div class="col s12 m12 l12">
                            <div class="file-field input-field">
                                <div class="btn blue">
                                    <span>浏览</span>
                                    <input type="file" name="stu">
                                </div>
                                <div class="file-path-wrapper">
                                    <input class="file-path validate" type="text" placeholder="请上传班级xcel表">
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col s12 m12 l12">
                            <h5>Excel要求格式:</h5>
                            <table class="bordered">
                                <thead>
                                <tr>
                                    <th data-field="id">学号</th>
                                    <th data-field="pwd">密码</th>
                                    <th data-field="dept">系部</th>
                                    <th data-field="class">班级</th>
                                    <th data-field="name">姓名</th>
                                    <th data-field="sex">性别</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr>
                                    <td>2014404104</td>
                                    <td>********</td>
                                    <td>信息工程系</td>
                                    <td>14计算机1班</td>
                                    <td>麦青强</td>
                                    <td>男</td>
                                </tr>
                                <tr>
                                    <td>2014404105</td>
                                    <td>********</td>
                                    <td>水利工程系</td>
                                    <td>14水利1班</td>
                                    <td>小芳</td>
                                    <td>女</td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <input type="submit" class="waves-effect waves-green btn-flat " value="导入">
                    <a href="#!" class="modal-close modal-close waves-effect waves-green btn-flat ">取消</a>
                </div>
            </form>
        </div>
    </div>
    <div class="row">
        <div class="col s12 m12 l12">
            <table class="striped centered responsive-table">
                <thead>
                <tr>
                    <th data-field="id">No</th>
                    <th data-field="name">学号</th>
                    <th data-field="name">系部</th>
                    <th data-field="name">班级</th>
                    <th data-field="price">姓名</th>
                    <th data-field="price">操作</th>
                </tr>
                </thead>

                <tbody>
                <volist name="ret" id="vo">
                    <tr>
                        <td>{$i}</td>
                        <td>{$vo.stuid}</td>
                        <td>{:getDeptName($vo[deptid])}</td>
                        <td>{:getClassName($vo[classid])}</td>
                        <td>{$vo.name}</td>
                        <td>
                            <a class="waves-effect waves-light btn green"
                               href="{:U('Admin/UserMag/editStu',array('id'=>$vo[id]))}">修改</a>
                            <a class="waves-effect waves-light btn red"
                               href="{:U('Admin/UserMag/delStu',array('id'=>$vo[id]))}">删除</a>
                        </td>
                    </tr>
                </volist>

                </tbody>
            </table>
        </div>
    </div>
</block>

<block name="js">
    <script>
        $(document).ready(function () {
            $('.modal-trigger').leanModal();
        });
    </script>
</block>